/*
 * @Author: WuFeng <763467339@qq.com>
 * @Date: 2022-03-22 12:12:49
 * @LastEditTime: 2023-05-19 17:46:48
 * @LastEditors: WuFeng <763467339@qq.com>
 * @Description: 路由
 * @FilePath: \vue3-element-plus-web\src\router\index.js
 * @Copyright 版权声明
 */
import { createRouter, createWebHashHistory } from 'vue-router'

// Layout
const Layout = () => import('@/views/Layouts/Admin/index.vue')

const routes = [
  {
    path: '/login',
    name: 'Login',
    component: () => import('@/views/Login/index.vue'),
    hidden: true
  },
  // {
  //   path: '/login',
  //   name: 'Login',
  //   component: () => import('@/views/BASE_MODULE/Login/index.vue'),
  //   hidden: true
  // },
  {
    path: '/404',
    component: () => import('@/views/404'),
    hidden: true
  },
  {
    path: '/',
    component: Layout,
    redirect: '/home',
    name: 'AdminLayout',
    hidden: false,
    meta: {
      top: true
    },
    children: [
      {
        path: 'home',
        name: 'home',
        component: () => import('@/views/Home'),
        meta: {
          title: '主页',
          icon: 'my-shouye'
        }
      }
    ]
  },
  {
    path: '/SysCommon',
    component: Layout,
    name: 'SysCommon',
    hidden: true,
    meta: {
      top: true
    },
    children: [
      {
        path: '/changePassword',
        name: 'changePassword',
        component: () => import('@/views/Setting/changePassword'),
        meta: {
          title: '修改密码'
        }
      }
    ]
  },
  {
    path: '/demo-wrap',
    component: Layout,
    meta: {
      icon: 'my-shezhi',
      title: 'DEMO'
    },
    children: [
      {
        path: '/genderCode',
        name: 'GenderCode',
        component: () => import('@/views/SysManage/GenderCode/index.vue'),
        meta: {
          title: 'GenderCode',
          handleAuth: {
          }
        }
      },
      {
        path: '/drawer-demo',
        name: 'DrawerDemo',
        component: () => import('@/views/DrawerDemo/index.vue'),
        meta: {
          title: 'Drawer DEMO',
          handleAuth: {
            DETAIL: true,
            CREATE: true,
            UPDATE: true,
            DELETE: true
          }
        }
      },
      {
        path: '/drawer-nest-demo',
        name: 'DrawerNestDemo',
        component: () => import('@/views/Demo/DrawerNestDemo/index.vue'),
        meta: {
          title: 'Drawer 嵌套缓存',
          handleAuth: {
            DETAIL: true,
            CREATE: true,
            UPDATE: true,
            DELETE: true
          }
        }
      },
      {
        path: '/drawer-simple-demo',
        name: 'DrawerSimpleDemo',
        component: () => import('@/views/DrawerSimpleDemo/index.vue'),
        meta: {
          title: 'Drawer DEMO SIMPLE',
          handleAuth: {
            DETAIL: true,
            CREATE: true,
            UPDATE: true,
            DELETE: true
          }
        }
      },
      {
        path: '/charts-demo',
        name: 'ChartsDemo',
        component: () => import('@/views/ChartsDemo/index.vue'),
        meta: {
          title: 'Charts DEMO',
          handleAuth: {
            DETAIL: true,
            CREATE: true,
            UPDATE: true,
            DELETE: true
          }
        }
      },
      {
        path: '/form-design-demo',
        name: 'FormDesignDemo',
        component: () => import('@/views/FormDesignDemo/index.vue'),
        meta: {
          title: 'Form Design Demo',
          handleAuth: {
            DETAIL: true,
            CREATE: true,
            UPDATE: true,
            DELETE: true
          }
        }
      },
      {
        path: '/upload-big',
        name: 'UploadBig',
        component: () => import('@/views/Demo/Upload/index.vue'),
        meta: {
          title: '文件资源库'
        }
      },
      {
        path: '/demo/video',
        name: 'DemoVideo',
        component: () => import('@/views/Demo/Video/index.vue'),
        meta: {
          title: '视频播放加字幕'
        }
      },
      {
        path: '/setting',
        name: 'Setting',
        component: () => import('@/views/Setting/index.vue'),
        meta: {
          title: '系统设置'
        }
      },
      {
        path: '/user',
        name: 'UserManage',
        component: () => import('@/views/User/index.vue'),
        meta: {
          title: '用户管理',
          handleAuth: {
            DETAIL: true,
            CREATE: true,
            UPDATE: true,
            DELETE: true
          }
        }
      },
      {
        path: '/demo/print',
        name: 'DemoPrint',
        component: () => import('@/views/Demo/Print/index.vue'),
        meta: {
          title: '静默打印'
        }
      }
    ]
  }
  // ,
  // {
  //   path: '/xtgl',
  //   component: Layout,
  //   meta: {
  //     icon: 'my-shezhi',
  //     title: '系统管理'
  //   },
  //   children: [
  //     {
  //       path: '/sys-manage/resource',
  //       name: 'SysManageResource',
  //       component: () => import('@/views/SysManage/Resource/index.vue'),
  //       meta: {
  //         title: '资源管理',
  //         handleAuth: {
  //           CREATE: true,
  //           DELETE: true,
  //           UPDATE: true,
  //           DETAIL: true,
  //           EXPORT: true
  //         }
  //       }
  //     },
  //     {
  //       path: '/sys-manage/role',
  //       name: 'SysManageRole',
  //       component: () => import('@/views/SysManage/Role/index.vue'),
  //       meta: {
  //         title: '角色管理',
  //         handleAuth: {
  //           CREATE: true,
  //           DELETE: true,
  //           UPDATE: true,
  //           DETAIL: true,
  //           EXPORT: true
  //         }
  //       }
  //     },
  //     {
  //       path: '/sys-manage/dept',
  //       name: 'SysManageDept',
  //       component: () => import('@/views/SysManage/Dept/index.vue'),
  //       meta: {
  //         title: '部门管理',
  //         handleAuth: {
  //           CREATE: true,
  //           DELETE: true,
  //           UPDATE: true,
  //           DETAIL: true,
  //           EXPORT: true
  //         }
  //       }
  //     },
  //     {
  //       path: '/sys-manage/user',
  //       name: 'SysManageUser',
  //       component: () => import('@/views/SysManage/SysUser/index.vue'),
  //       meta: {
  //         title: '用户管理',
  //         handleAuth: {
  //           CREATE: true,
  //           DELETE: true,
  //           UPDATE: true,
  //           DETAIL: true,
  //           EXPORT: true
  //         }
  //       }
  //     },
  //     {
  //       path: '/sys-manage/monitor',
  //       name: 'SysManageMonitor',
  //       component: () => import('@/views/SysManage/Monitor/index.vue'),
  //       meta: {
  //         title: '系统监控',
  //         handleAuth: {
  //         }
  //       }
  //     },
  //     {
  //       path: '/sys-manage/robot',
  //       name: 'SysManageRobot',
  //       component: () => import('@/views/SysManage/Robot/index.vue'),
  //       meta: {
  //         title: '代码生成',
  //         handleAuth: {
  //         }
  //       }
  //     }
  //   ]
  // }
]

const router = createRouter({
  history: createWebHashHistory(),
  routes
})

export const constantRouterMap = routes

export default router
